import 'package:plugin_platform_interface/plugin_platform_interface.dart';

import 'flutter_huawei_cloud_method_channel.dart';
import 'src/obs_progress.dart';

abstract class FlutterHuaweiCloudPlatform extends PlatformInterface {
  /// Constructs a FlutterHuaweiCloudPlatform.
  FlutterHuaweiCloudPlatform() : super(token: _token);

  static final Object _token = Object();

  static FlutterHuaweiCloudPlatform _instance =
      MethodChannelFlutterHuaweiCloud();

  /// The default instance of [FlutterHuaweiCloudPlatform] to use.
  ///
  /// Defaults to [MethodChannelFlutterHuaweiCloud].
  static FlutterHuaweiCloudPlatform get instance => _instance;

  /// Platform-specific implementations should set this with their own
  /// platform-specific class that extends [FlutterHuaweiCloudPlatform] when
  /// they register themselves.
  static set instance(FlutterHuaweiCloudPlatform instance) {
    PlatformInterface.verifyToken(instance, _token);
    _instance = instance;
  }

  Future<String?> getPlatformVersion() {
    throw UnimplementedError('platformVersion() has not been implemented.');
  }

  Future<void> initialize({
    required String accessKey,
    required String secretKey,
    required String region,
  }) {
    throw UnimplementedError(
      'initialize({required String accessKey, required String secretKey, required String region}) has not been implemented.',
    );
  }

  Future<String?> uploadFile(
    String bucketName,
    String objectKey,
    String filePath,
  ) {
    throw UnimplementedError(
      'uploadFile(String bucketName, String objectKey, String filePath) has not been implemented.',
    );
  }

  Future<Map<String, String>?> uploadMultipleFile(
    String bucketName,
    List<Map<String, String>> files,
  ) {
    throw UnimplementedError(
      'uploadMultipleFile(String bucketName, List<Map<String, String>> files) has not been implemented.',
    );
  }

  Stream<OBSProgress> get onUploadProgress {
    throw UnimplementedError('onUploadProgress has not been implemented.');
  }
}
